<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@include file="../base_path.jsp" %>
<html>

<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Expires" content="0">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="description" content="">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/lib/bootstrap/3.3.7/css/bootstrap.min.css" />
	<link type="text/css" rel="stylesheet" href="<%=basePath%>/lib/bootstrap-select/css/bootstrap-select.min.css" />
	<link type="text/css" rel="stylesheet" href="<%=basePath%>/lib/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="<%=basePath%>/lib/jqgrid/5.2.1/css/ui.jqgrid-bootstrap.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="<%=basePath%>/lib/lobibox/css/lobibox.min.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="<%=basePath%>/css/mycss.css" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/pageNav.css" />
	<title>机器人监控</title>

</head>

<body>
<style type="text/css">
	.aphone {
		border: 1px solid #e1e1e1;
		width: 500px;
		height: 390px;
		margin-bottom: 20px;
		border-top: none;
		border-bottom-width: 5px;
		background: #FFFFFF;
		position: relative;
	}

	.task-end {
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0px;
		left: 0px;
		background: rgba(61, 61, 61, 0.5);
		z-index: 111;
		display: none;
		text-align: center;
		line-height: 390px;
		color: #FFF;
	}

	.detail-left {
		width: 700px;
		float: left;
		border-right: 1px solid #DDD;

	}

	.detail-left .detail-head {
		background: linear-gradient(to right, #3247c7, #3273fa);
		color: #FFF;
	}

	.detail-right .detail-head {
		background:  #3273fa;
		color: #FFF;
	}

	.detail-left .detail-head .btn-default {
    color: #333;
    background-color: transparent;
    border-color: #ccc;
	border-color: transparent;;
}

	.detail-right {
		width: 398px;
		float: left;
	}

	.htext {
		position: fixed;
		top: -5000px;
	}

	.phone-head {
		height: 35px;
		background: #eff1f7;
	}

	.phone-head .phone-time {
		height: 35px;
		display: inline-block;
		background: #38d672;
		line-height: 35px;
		width: 60px;
		color: #FFF;
		text-align: center;
	}

	.no-phone .phone-head .phone-time {
		background: #F00;
	}

	.phone-main {
		height: 359px;
		overflow: hidden;
		padding: 10px;
	}

	.smaller-div {
		width: 110%;
		margin-left: -5%;
		transform: scale(0.9, 0.9);
		-webkit-transform: scale(0.9, 0.9);
		-moz-transform: scale(0.9, 0.9);
		-o-transform: scale(0.9, 0.9);
		background: #eff1f7;
	}

	#wave_detail {
		width: 668px;
		height: 120px;
		background: #002138;
	}

	wave {
		background: #002138;
	}

	.wave {
		background: #002138;
	}

	#myModal .modal-body {
		padding-top: 0;
	}

	.detail-head {
		padding: 10px 0px;
		border-bottom: 1px solid #DDD;
		margin: 0;
	}

	.detail-head .close {
		line-height: 16px;
		color: #fff;
    text-shadow:none;

     opacity: 1;
	}

	.detail-head .detail-title {
		font-size: 16px;
		font-weight: 600;
		line-height: 22px;
		color: #FFF;
	}

	.detail-head .detail-status {
		font-size: 16px;
		font-weight: 600;
		margin-left: 15px;
		line-height: 22px;
	}

	.detail-head .detail-status.duration {
		color: rgb(137, 194, 76)
	}

	.detail-head button {
		margin-right: 10px;
	}

	.marginlr-0 {
		margin-left: 0;
		margin-right: 0;
	}

	.workbench-box {
		height: 670px;
	}

	.padding-0 {
		padding: 0;
	}

	.intention-title {
		font-weight: 600;
		font-size: 14px;
	}

	.intention-button .btn {
		width: 100%;
		color: #3273fa;
		border-color:  #3273fa;
		border-radius: 4px;
	}

	.intention-button .btn:hover {
		background-color:  #3273fa;
		color:#FFF;
	}

	.intention-row-active .intention-button .btn {
		background-color:  #3273fa;
		color:#FFF;
	}

	.intention-row-first .rank {
		background-color: #3273fa
	}

	.rank {
		font-size: 12px;
		text-align: center;
		line-height: 20px;
		width: 22px;
		height: 22px;
		border: 1px solid #3273fa;
		display: inline-block;
		border-radius: 50%;
		background: #3273fa;
		color: #FFF;
	}

	.message-face img {
		width: 28px;
		height: 28px;
		border-radius: 50%;
		/* background: #DDDDDD; */
	}

	.message-text {
		padding-top: 5px;
		padding-bottom: 5px;
		position: relative;
	}

	.robot-message .message-text {
		background: #d2d6de;
		border-radius: 5px;
		line-height: 18px;
		font-size: 12px;
		position: relative;
	}

	.robot-message .message-text::after {
		content: "";
		width: 15px;
		height: 15px;
		position: absolute;
		left: -3px;
		top: 7px;
		background: #d2d6de;
		transform: rotateZ(45deg);
		transform-origin: center;
		z-index: 11;
	}

	.user-message .message-text {
		background: #3c8dbc;
		border-radius: 5px;
		line-height: 18px;
		font-size: 12px;
		position: relative;
		color: #FFF;
		background: #c9d8f8;
		border-color: #c9d8f8;
		color: #3273fa;
	}

	.user-message .message-text::after {
		content: "";
		width: 15px;
		height: 15px;
		position: absolute;
		right: -3px;
		top: 7px;
		background: #c9d8f8;
		transform: rotateZ(45deg);
		transform-origin: center;
		z-index: 11;
	}

	.direct-chat-messages {
		overflow-x: hidden;
	}

	.margin-bottom-0 {
		margin-bottom: 0;
	}

	.query-condition label {
		line-height: 30px;
	}


	.aui-switch:checked {

		border-color: rgb(0, 224, 104);
		background-color: rgb(0, 224, 104);
	}

	.aui-switch {
		width: 60px;
		height: 28px;
		position: relative;
		vertical-align: top;
		border: 1px solid #dddddd;
		background-color: #dddddd;
		border-radius: 15px;
		background-clip: content-box;
		display: inline-block;
		outline: none;
		-webkit-appearance: none;
		appearance: none;
		-webkit-user-select: none;
		user-select: none;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
		-webkit-background-clip: padding-box;
		background-clip: padding-box;
		-webkit-transition: all 0.2s linear;
		transition: all 0.2s linear;
		outline-style: none;
		outline: none !important;
	}

	.aui-switch:checked:before {
		left: 32px;
	}

	.aui-switch:before {
		width: 24px;
		height: 24px;
		position: absolute;
		top: 1px;
		left: 0;
		border-radius: 12px;
		background-color: #fff;
		content: '';
		-webkit-transition: left 0.2s;
		transition: left 0.2s;
	}

	.margin-top-0 {
		margin-top: 0px !important;
	}

	.phone-head .btn {
		outline: none !important;
	}

	.phone-head .btn {
		position: relative;
		top: -2px;
		background: transparent;
		border: none;
	}

	.aphone .direct-chat-messages {
		height: 215px;
	}

	.intention-button .btn {
		white-space: normal;
		transition: 0.3s;
	}

	#audio_progress2 {
		-webkit-transition: width .0s ease;
		-o-transition: width .0s ease;
		transition: width .0s ease;
	}

	.faq-bottom {}

	.branch {
		height: 600px;
		display: box;
		/* OLD - Android 4.4- */
		display: -webkit-box;
		/* OLD - iOS 6-, Safari 3.1-6 */
		display: -moz-box;
		/* OLD - Firefox 19- (buggy but mostly works) */
		display: -ms-flexbox;
		/* TWEENER - IE 10 */
		display: -webkit-flex;
		/* NEW - Chrome */
		display: flex;
		/* NEW, Spec - Opera 12.1, Firefox 20+ */
		-webkit-flex-direction: column;
		-moz-flex-direction: column;
		-ms-flex-direction: column;
		-o-flex-direction: column;
		flex-direction: column;
		-webkit-justify-content: space-between;
		-moz-justify-content: space-between;
		-ms-justify-content: space-between;
		-o-justify-content: space-between;
		justify-content: space-between;
	}

	.phone-head .btn {
		padding: 6px 4px;
	}

	.phone-info {
		background: #eff1f7;
		border-radius: 3px;
		padding: 10px;
		margin-bottom: 10px;
	}

	.box {
		border-top: none;
		box-shadow: none;
	}

	.audio-text-list {
		background: #eff1f7;
	}

	.message-face {
		padding-left: 10px;
	}

	.a-message {
		margin-bottom: 13px;
	}

	#workbench-worker {
		transform:rotate(180deg);
		-ms-transform:rotate(180deg); 	/* IE 9 */
		-moz-transform:rotate(180deg); 	/* Firefox */
		-webkit-transform:rotate(180deg); /* Safari 和 Chrome */
		-o-transform:rotate(180deg); 	/* Opera */
	}

	#workbench-worker.open {
		transform:rotate(0deg);
		-ms-transform:rotate(0deg); 	/* IE 9 */
		-moz-transform:rotate(0deg); 	/* Firefox */
		-webkit-transform:rotate(0deg); /* Safari 和 Chrome */
		-o-transform:rotate(0deg); 	/* Opera */
	}

	.progress-bar {
		    background-color: #06cc4f;
	}

	#myModal .panel-defaul {
		border-color: transparent;
	}
</style>
<div class="navbar-fixed-top">
	<div class="breadcrumb">
		<span>系统监控</span>/
		<span class="active">实时监听</span>
		<span class="pull-right" title="刷新">
					<div class="btn-refresh" onclick="location.replace(location.href);">
						<img src="<%=basePath%>/images/refresh.png" >
					</div>
				</span>

	</div>
</div>

<div class="container-fluid">
	<div class="container-fluid-main">
	<div class="panel panel-default panel-default-sample" style="border: none;box-shadow: none;">
		<div class="panel-body" style="background: #f5f8ff;border: none;box-shadow: none;">
			<div>

				<div class="form-group row margin-bottom-0 query-condition">
					<label class="control-label col-md-1 col-sm-2 col-xs-4" for="txt_business_template">业务</label>
					<div class="col-md-2 col-sm-4 col-xs-8">
						<select id="txt_business_template" class="selectpicker form-control input-sm" multiple data-live-search="true"
								title="请选择" name="txt_business_template" data-live-search-placeholder="Search" data-actions-box="true">
						</select>
					</div>
<%--					<label class="control-label col-md-1 col-sm-2 col-xs-4" for="txt_task">任务</label>--%>
<%--					<div class="col-md-2 col-sm-4 col-xs-8">--%>
<%--						<select id="txt_task" class="selectpicker form-control input-sm" multiple data-live-search="true" title="请选择"--%>
<%--								name="txt_task" data-live-search-placeholder="Search" data-actions-box="true">--%>
<%--						</select>--%>
<%--					</div>--%>
					<label class="control-label col-md-1 col-sm-2 col-xs-4" for="txt_phone_number">号码</label>
					<div class="col-md-2 col-sm-4 col-xs-8">
						<input type="text" class="form-control input-sm" id="txt_phone_number" maxlength="11">
					</div>
					<label class="control-label col-md-1 col-sm-2 col-xs-4" >实时监听开关</label>
					<div class="col-md-2 col-sm-4 col-xs-8">
						<input type="checkbox" class="aui-switch margin-top-0" id="aui-check">
						<button class="btn btn-primary btn-sm search-rule" style="float: right" onclick="search();" disabled="disabled">查询</button>
					</div>
				</div>

			</div>
		</div>
	</div>
	<div class="panel panel-default panel-default-sample" style="border: none;box-shadow: none;">
		<div class="panel-body">
			<div class="row" id="phone-list">
			</div>
			<nav aria-label="Page navigation" class="page-nav-outer text-right" id="PageNavId"></nav>
		</div>
	</div>
	</div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 1100px;">
		<div class="modal-content" style="width:1100px;">
			<div class="modal-body row">
				<div class="detail-left">
					<div class="row detail-head">
						<div class="col-xs-6 text-left part">
							<span class="detail-title">对话详情</span>
							<span class="detail-status duration">监听中...</span>
						</div>
						<div class="col-xs-6 text-right part">
							<button type="button" class="btn btn-default btn-xs favor-btn" onclick="toggleFavor(1,detailCallInfo.call_id,this);"><img src="<%=basePath%>/images/monitor/favor.png" ></button>
							<button type="button" class="btn btn-default btn-xs unfavor-btn" onclick="toggleFavor(0,detailCallInfo.call_id,this);"><img src="<%=basePath%>/images/monitor/unfavor.png" ></button>
							<button type="button" class="btn btn-default btn-xs" id="workbench-worker" onclick="toggleWorkBench();"><img src="<%=basePath%>/images/monitor/open.png" ></button>
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="$('#myModal').modal('hide')"><span aria-hidden="true">×</span></button>
						</div>
					</div>
					<div class="row marginlr-0 margin-top-10">
						<div class="col-xs-12">
							<div class="panel panel-default" style="background: #eff1f7;border: none;">
								<div class="panel-body">
									<div class="row">
<%--										<div class="col-xs-4" id="div_task_name">外呼任务：<span class="detailTask"></span></div>--%>
										<div class="col-xs-4">所属业务：<span class="detailBusiness"></span></div>
										<div class="col-xs-4">电话号码：<span class="detailPhone"></span></div>
									</div>
								</div>
							</div>
						</div>
					</div>

					<div class="row marginlr-0 margin-top-10">
						<div class="col-xs-12">
							<div class="panel panel-default" style="border: none;">
								<div class="panel-body">
									<div class="row">
										<div class="progress">
											<div class="progress-bar" id="audio_progress" role="progressbar" aria-valuenow="0" aria-valuemin="0"
												 aria-valuemax="100" style="width: 100%;">100%</div>
										</div>
									</div>
									<div class="row wave-row">
										<div id="wave_detail" style=""></div>
									</div>
									<div style="margin-top: 15px">
										<form class="form-horizontal" id="">
											<div class="form-group">
												<label class="" for="select_manual_check_result" style="float: left;line-height: 30px;">人工校验</label>
												<div class="col-xs-2">
													<select class="form-control input-sm" id="select_manual_check_result">
														<option value="0">-请选择-</option>

														<option value="0">默认</option>

														<option value="1">成功</option>

														<option value="2">失败</option>

														<option value="3">有意向</option>

														<option value="4">无结果</option>

														<option value="5">兜底</option>

														<option value="6">随销</option>

														<option value="20">疑似办理</option>

														<option value="21">强制办理</option>

													</select>
												</div>

												<label class="control-label col-xs-1" for="txt_manual_check_comment" style="padding-right: 0px;">备注</label>
												<div class="col-xs-5">
															<textarea onkeyup="value=value.replace(/[^a-zA-Z0-9\u4E00-\u9FA5,，。.]/g,'')" id="txt_manual_check_comment"
																	  class="form-control input-sm" maxlength="80" placeholder="最多填写80个字..." style="height: 30px;"></textarea>
												</div>
												<div class="col-xs-1">
													<button type="button" class="btn btn-primary btn-sm" value="保存" id="form_manual_check">保存</button>
												</div>
											</div>
										</form>
									</div>



									<div class="box box-primary direct-chat direct-chat-primary">
										<div class="box box-primary direct-chat direct-chat-primary" id="dialog_info">
											<div class="direct-chat-messages audio-text-list detail-text">
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>
					</div>
					<!--/.direct-chat-messages-->

				</div>
				<div class="detail-right" status='1' id="workbench">
					<div class="row detail-head">
						<div class="col-xs-6 text-left part">
							<span class="detail-title">工作台</span>
						</div>
						<div class="col-xs-6 text-right part">
							<button type="button" class="close" onclick="toggleWorkBench();" aria-hidden="true">&times;</button>
						</div>
					</div>
					<div class="workbench-box">
						<div class="col-xs-12">
							<div class="row marginlr-0 margin-top-10">
								<div class="progress col-xs-11 padding-0">
									<div class="progress-bar progress-bar-success" id="audio_progress2" role="progressbar" aria-valuenow="0"
										 aria-valuemin="0" aria-valuemax="100" style="width: 0;">0s</div>
								</div>
								<div class="col-xs-1">
									<input type="checkbox" />
								</div>
							</div>
							<div class="row">
								<div class="col-xs-6">
									<div class="row">
										<div class="col-xs-2 text-center"></div>
										<div class="col-xs-10 text-center intention-title">分支意图</div>
									</div>

								</div>
								<div class="col-xs-6">
									<div class="row">
										<div class="col-xs-2 text-center"></div>
										<div class="col-xs-10 text-center intention-title">FAQ意图</div>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="col-xs-6 branch">
									<!-- <div class="branch-top">

									</div> -->
									<div class="branch-top"><div class="row margin-top-10 intention-row" intention="是否判断 Yes" onclick="sendInfo(this,1011)">												<div class="col-xs-2 text-center intention-rank"><span class="rank">1</span></div>												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">是否判断 Yes</button></div>											</div><div class="row margin-top-10 intention-row" intention="是否判断 No" onclick="sendInfo(this,1011)">												<div class="col-xs-2 text-center intention-rank"></div>												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">是否判断 No</button></div>											</div><div class="row margin-top-10 intention-row" intention="是否判断 Other" onclick="sendInfo(this,1011)">												<div class="col-xs-2 text-center intention-rank"></div>												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">是否判断 Other</button></div>											</div></div>
									<div class="faq-bottom"></div>
									<!-- <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">接受回访</button></div>
                                    </div>
                                    <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"><span class="rank">1</span></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">拒绝回访</button></div>
                                    </div> -->
								</div>
								<div class="col-xs-6 faq">
									<!-- <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">接受回访</button></div>
                                    </div>
                                    <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"><span class="rank">2</span></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">拒绝回访</button></div>
                                    </div>
                                    <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"><span class="rank">3</span></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">接受回访</button></div>
                                    </div>
                                    <div class="row margin-top-10">
                                        <div class="col-xs-2 text-center"></div>
                                        <div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">拒绝回访</button></div>
                                    </div> -->
									<!--  -->



									<!--  -->
								</div>
							</div>
						</div>
					</div>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
</div>
<input type="hidden" value="sss">
<div id="wave123" style="width: 500px;height:300px"></div>
<!-- 详情模态框（Modal） -->
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="<%=basePath%>/lib/jquery/1.11.0/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/bootstrap/3.3.7/js/bootstrap.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/bootstrap-select/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/bootbox/bootbox.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/jqgrid/5.2.1/js/i18n/grid.locale-cn.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/jqgrid/5.2.1/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/client.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/pcm-player.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/wavesurfer.js"></script>


<script type="text/javascript" src="<%=basePath%>/lib/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/jquery.validation/1.14.0/jquery.validate_1.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/lobibox/js/lobibox.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/lobibox/js/messageboxes.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/lobibox/js/notifications.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/JQuery.md5.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/common.js"></script>
<script type="text/javascript" src="<%=basePath%>/lib/pageNav.js"></script>


<script type="text/javascript">
    //打开链接
    <%--var ws = new WebSocket("${websocketAddress}");--%>
    <%--ws.onopen = function(e) {--%>
    <%--    // console.log('链接打开');--%>
    <%--    // console.log("ws=" + ws)--%>
    <%--    ws.send(new Date().getTime());--%>
    <%--}--%>
    <%--ws.onmessage = function(e) {--%>
    <%--    var data = JSON.parse(e.data);--%>

    <%--    // console.info('接受到数据：' + e.data);--%>
    <%--    endTask.push(e.data)--%>

    <%--    $('.phone-col').each(function(index, item) {--%>
    <%--        var taskId = $(item).find('.task_id').eq(0).val();--%>
    <%--        if (e.data == taskId) {--%>
    <%--            $(item).find('.task-end').css('display', 'block');--%>
    <%--        }--%>
    <%--    });--%>
    <%--}--%>


    var showCallControlSwitch = ${envAccessConfig.realTimeMonitorSwitch}
    var callOperateDuration = ${envAccessConfig.callOperateDuration}
    var grpcHost = '${grpcHost}';
    var channels = 2; //声道
    var sampleRate = 8000; //采样率
    window['playId'] = ''; //当前播放的窗口通话id
    var waveArr = [] //记录所有wavesurfer实例
    var intervalArr = [] //记录所有定时器
    var pageNavObj = null; //用于储存分页对象
    var allResult; //查询结果
    var result; //分页结果
    var wave_detail // 通话详情wavesurfer实例
    // var _rid; // 所打开通话详情的robot_id

    var pageSize = 3; //每页显示通话个数
    var currentPage = 0; //当前分页
    var intentionFlag = false;
    var flushCallInfoCount = 0;
    var sndInfoOnceTimer = null; // 干预计时器


    var taskColor = ['#FF60AF', '#FFA042', '#FFDC35', '#A8FF24', '#009100', '#00CACA', '#0080FF', '#9393FF', '#8F4586',
        '#FF2D2D'
    ];
    var taskColorIndex = 0;
    var taskObj = {};

    var intentionTime = 0;
    var nextIntention;

    var modalStatus = false;
    var detailCallId;
    var createNotify = null;



    var detailCallInfo = {}; //打开详情通话信息


    var audioCTXDetail;
    var longAudioBufLenDetail;
    var longAudioBufDetail;
    var longAudioBufPosDetail;

    var endTask = []; //已结束的任务
    var audioStreamArr = [];
    var infoStreamArr = [];

    if (!showCallControlSwitch) {
        toggleWorkBench();
        $('#workbench-worker').hide();
    }


    // 实时监听开关
    $('#aui-check').change(function() {
        // console.log($(this).prop('checked'));
        var flag = $(this).prop('checked');
        if (!flag) {
            $('.search-rule').attr('disabled', 'disabled');
            $('#phone-list').html(''); //清空页面
            clearWaveArr();
            localStorage.isListen = 'false';
        } else {
            $('.search-rule').removeAttr('disabled');
            search();
            localStorage.isListen = 'true';
        }
    });

    if(localStorage.isListen == 'true') {
        $('#aui-check').click();
    }

    // 初始化pcm-player
    window.player = new PCMPlayer({
        encoding: '16bitInt',
        channels: channels,
        sampleRate: sampleRate,
        flushingTime: 200,
        log_info: false
    });


    function initPager() {
        // 分页容器初始化
        // console.log(Math.ceil((allResult.length / pageSize)))
        // console.log(currentPage)
        pageNavObj = new PageNavCreate("PageNavId", {
            pageCount: Math.ceil((allResult.length / pageSize)),
            currentPage: currentPage + 1,
            perPageNum: pageSize,
        });
        pageNavObj.afterClick(pageNavCallBack);
    }

    function pageNavCallBack(clickPage) {
        // console.log(clickPage)
        currentPage = clickPage - 1;
        result = allResult.slice(pageSize * currentPage, pageSize * (currentPage + 1));
        $('#phone-list').html(''); //清空页面
        clearWaveArr();
        init();
        pageNavObj = new PageNavCreate("PageNavId", {
            pageCount: Math.ceil((allResult.length / pageSize)),
            currentPage: clickPage,
            perPageNum: pageSize,
        });
        pageNavObj.afterClick(pageNavCallBack);
    }

    // 清空波形图对象数组
    function clearWaveArr() {
        $(infoStreamArr).each(function(index, item) {
            item.cancel();
        })

        $(audioStreamArr).each(function(index, item) {
            item.cancel();
        })

        $(intervalArr).each(function(index, item) {
            clearInterval(item);
            item = null;
        })

        $(waveArr).each(function(index, item) {
            item.destroy();
        })
    }


    //获取通话列表
    function search() {
        var reg= /^[0-9]*$/
        var businessId = $("#txt_business_template").val()
        if(businessId) {
            businessId =businessId.join(',');
        }
        // var taskId = $("#txt_task").val();
        // if(taskId) {
        //     taskId =taskId.join(',');
        // }
        var phoneNumber = $("#txt_phone_number").val();
        if(phoneNumber&&!reg.test(phoneNumber)) {
            bootbox.alert("手机号码不符合规则请重新输入");
            return
        }
        $.ajax({
            url: "<%=basePath%>/monitor/getRunningTask.do",
            type: "post",
            dataType: "json",
            data: {
                "businessId": businessId,
                // "taskId": taskId,
                "phoneNumber": phoneNumber
            },
            success: function(data) {
                if (data["errorCode"] == "0") {
                    if (data.list.length == 0) {
                        $('#phone-list').html(''); //清空页面
                        clearWaveArr();
                        myNotify("error", "", "当前没有电话正在通话");
                    } else {
                        allResult = data.list;
                        // console.log(data)
                        currentPage = 0;
                        result = allResult.slice(pageSize * currentPage, pageSize * (currentPage + 1));
                        $('#phone-list').html(''); //清空页面
                        clearWaveArr();
                        initPager();
                        init();

                    }
                }
            },
            error: function(data) {
                // console.log('网络 异常1');
                myNotify("error", "", "网络异常！");
            }
        });
    }


    initOptions();
    //获取业务列表、任务列表
    function initOptions() {
        $.ajax({
            url: "<%=basePath%>/monitor/getRunningBuSiAndTask.do ",
            type: "post",
            dataType: "json",
            success: function(data) {
                if (data["errorCode"] == "0") {
                    var busiList = data.list[0];
                    // var taskList = data.list[1];
                    for (var i = 0; i < busiList.length; i++) {
                        var option = document.createElement("option");
                        $(option).val(busiList[i].business_id);
                        $(option).text(busiList[i].business_name);
                        $('#txt_business_template').append(option);
                    }
                    // for (var i = 0; i < taskList.length; i++) {
                    //     var option = document.createElement("option");
                    //     $(option).val(taskList[i].task_id);
                    //     $(option).text(taskList[i].task_name);
                    //     $('#txt_task').append(option);
                    // }
                    $('#txt_business_template').selectpicker('refresh'); //动态刷新
                    // $('#txt_task').selectpicker('refresh'); //动态刷新
                }
            },
            error: function(data) {
                // console.log('网络 异常2');
                myNotify("error", "", "网络异常！");
            }
        });
    }

    <%--$('#txt_business_template').on('changed.bs.select', function(e) {--%>
    <%--    var val = $('#txt_business_template').val();--%>
    <%--    // console.log(val)--%>
    <%--    if (val) {--%>
    <%--        val = val.join(',')--%>
    <%--        $.ajax({--%>
    <%--            url: "<%=basePath%>/monitor/getRunningTaskByBusi.do ",--%>
    <%--            type: "post",--%>
    <%--            dataType: "json",--%>
    <%--            data: 'businessId=' + val,--%>
    <%--            success: function(data) {--%>
    <%--                if (data["errorCode"] == "0") {--%>
    <%--                    var taskList = data.list;--%>
    <%--                    $('#txt_task').html('');--%>
    <%--                    for (var i = 0; i < taskList.length; i++) {--%>
    <%--                        var option = document.createElement("option");--%>
    <%--                        $(option).val(taskList[i].task_id);--%>
    <%--                        $(option).text(taskList[i].task_name);--%>
    <%--                        $('#txt_task').append(option);--%>
    <%--                    }--%>
    <%--                    $('#txt_task').selectpicker('refresh');--%>
    <%--                }--%>
    <%--            },--%>
    <%--            error: function(data) {--%>
    <%--                // console.log('网络 异常3');--%>
    <%--                myNotify("error", "", "网络异常！");--%>
    <%--            }--%>
    <%--        });--%>
    <%--    } else {--%>
    <%--        $('#txt_task').html('');--%>
    <%--        $('#txt_task').selectpicker('refresh'); //动态刷新--%>
    <%--    }--%>
    <%--})--%>

    function init() {
        flushCallInfoCount = 0;
        //更新实时数据
        $(result).each(function(index, item) {
            flushCallInfo(item, index, 30)
        })
    }

    function flushCallInfo(call, index, timeout) {
        timeout--
        $.ajax({
            type: 'POST',
            url: '<%=basePath%>/monitor/checkAndFlushCallInfo.do',
            async: false,
            data: call,
            success: function(data) {
            	// console.log(data)
                if (data["errorCode"] == "0") {
                    if(data.list.length > 0 && data.list[0].robot_id) {
                        result[index] = data.list[0];
                        allResult[currentPage*pageSize + index] =  data.list[0];
                        flushCallInfoCount++;
                        if(flushCallInfoCount == result.length) {
                            renderResult();
                        }
                    }else if(data.list.length > 0 && !data.list[0].robot_id) {
                        if(timeout>0) {
                            setTimeout(function() {
                                flushCallInfo(call, index, timeout);
                            }, 1000)
                        }
                    }else {
                        flushCallInfoCount++;
                        if(flushCallInfoCount == result.length) {
                            renderResult();
                        }
                    }
                }
            },
            error: function(data) {
                // console.log('网络 异常4');
                myNotify("error", "", "网络异常！");
            }
        });
    }

    function renderResult() {
    	console.log("++++++++++++++++++++++++")
        $(result).each(function(index, item) {
            var dom = returnDom(item);
            var _phone = '<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 phone-col" position="' + index + '">' +
                dom +
                '						</div>';

            $('#phone-list').append(_phone);
            $('#phone-list').find('.aphone').eq(index).find('.pause-btn').hide();
            if (item.robot_id) {
                nextSecond($('#phone-list').find('.aphone').eq(index));
            } else {
                $('.phone-col').eq(index).find('.aphone').attr('onListen', 'false')
            }
            if (item.callCount == 0) {
                $('#phone-list').find('.aphone').eq(index).find('.unfavor-btn').hide();
            } else {
                $('#phone-list').find('.aphone').eq(index).find('.favor-btn').hide();
            }

            // if (endTask.indexOf(item.task_id) > -1) {
            //     // console.log(item.task_id)
            //     $('.phone-col').eq(index).find('.aphone').find('.task-end').css('display', 'block')
            // }
        });


        $('.wave').each(function(index, item) {
            var nodeId = $(this).attr('id');
            var nodeRid = $(this).parent('.phone-main').find('.robot_id').eq(0).val();
            if (nodeRid) {
                window[nodeId] = WaveSurfer.create({
                    container: '#' + nodeId,
                    waveColor: "#007477", //波纹
                    progressColor: "#F00",
                    hideScrollbar: false, //隐藏波纹的横坐标
                    cursorColor: "#002138",
                    height: 60,
                    responsive: true,
                    scrollParent: true,
                    maxCanvasWidth: 50000, // canvas的最大值
                    splitChannels: false,
                    interact: false,
                    barHeight: 0.8,
					backgroundColor: "#002138"
                });
                waveArr.push(window[nodeId])
                listenAphone(nodeRid, window[nodeId], nodeId)
            }
        })
    }

    function returnDom(item) {
		console.log("==========================================")
    	console.log(taskObj)
		console.log(item)
		console.log("==========================================")
        var borderBtmColor;
        if (taskObj[item.business_id]) {
            borderBtmColor = taskObj[item.business_id];
        } else {
            taskObj[item.business_id] = taskColor[taskColorIndex];
            taskColorIndex++;
            if (taskColorIndex == 10) {
                taskColorIndex = 0;
            }
            borderBtmColor = taskObj[item.business_id];
        }
        // console.log(borderBtmColor)
        var dom = '<div class="aphone" onListen="true" id="Listenr' + item.robot_id + '" style="border-bottom-color:' +
            borderBtmColor + '">' +
            '								<div class="task-end">任务已结束</div>' +
            '								<div class="phone-head text-right">' +
            '                                <button type="button" class="btn btn-default pause-btn" aria-label="Left Align"   onclick="pauseThis(this)" target="wave' +
            item.robot_id + '">' +
            // '					<span class="glyphicon glyphicon-pause" aria-hidden="true"></span>' +
			'                 <img src="<%=basePath%>/images/monitor/pause.png" >'+
            '				</button>' +
            '				<button type="button" class="btn btn-default play-btn" aria-label="Left Align"  onclick="playThis(this)" target="wave' +
            item.robot_id + '">' +
            // '					<span class="glyphicon glyphicon-play" aria-hidden="true"></span>' +
			'                 <img src="<%=basePath%>/images/monitor/play.png" >'+
            '				</button>' +
            '				<button type="button" class="btn btn-default unfavor-btn" aria-label="Left Align" onclick="toggleFavor(0,' +
            item.call_id + ',this);">' +
            // '					<span class="glyphicon glyphicon-star" aria-hidden="true"></span>' +
			'                 <img src="<%=basePath%>/images/monitor/unfavor.png" >'+
            '				</button>' +
            '				<button type="button" class="btn btn-default favor-btn" aria-label="Left Align" onclick="toggleFavor(1,' +
            item.call_id + ',this);">' +
            // '					<span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>' +
			'                 <img src="<%=basePath%>/images/monitor/favor.png" >'+
            '				</button>' +
            // 					'									<button onclick="playThis(this)" target="wave' + item.robot_id + '">播放</button>' +
            // 						'									<button>收藏</button>' +
            '									<span class="phone-time">' + item.time + 'S</span>' +
            '								</div>' +
            '								<div class="phone-main">' +
			'							<div class="phone-info">' +
			'								<div class="row">' +

			'									<div class="col-xs-4" style="padding-right: 0px">所属业务：'+item.business_name+'</div>' +
			// '									<div class="col-xs-4" style="padding-right: 0px">类型：呼入</div>' +
			'									<div class="col-xs-4" style="padding-right: 0px">电话号码：'+item.phone_number+'</div>' +

			// '									<div class="col-xs-4" style="padding-right: 0px">外呼时间：'+item.call_time+'</div>' +
			'								</div>' +
			'							</div>' +
            // '							<input type="text" class="htext task_name" name="task_name" value="' + item.task_name + '">' +
            '							<input type="text" class="htext business_name" name="business_name" value="' + item.business_name + '">' +
            '							<input type="text" class="htext call_count" name="call_count" value="' + item.callCount + '">' +
            '							<input type="text" class="htext robot_id" name="robot_id" value="' + item.robot_id + '">' +
            '							<input type="text" class="htext call_time" name="call_time" value="' + item.call_time + '">' +
            // '							<input type="text" class="htext task_id" name="task_id" value="' + item.task_id + '">' +
            '							<input type="text" class="htext time" name="time" value="' + item.time + '">' +
            '							<input type="text" class="htext business_id" name="business_id" value="' + item.business_id + '">' +
            '							<input type="text" class="htext call_id" name="call_id" value="' + item.call_id + '">' +
            '									<div id="wave' + item.robot_id + '" class="wave" style="width: 476px;height: 60px"></div>' +
            '																		<div style="margin-top: 15px" class="smaller-div">' +

            '								</div>' +
            '							' +
            '							' +
            '							' +
            '								<div class="box box-primary direct-chat direct-chat-primary smaller-div">' +
            '									<div class="box box-primary direct-chat direct-chat-primary">' +
            '										<div class="direct-chat-messages audio-text-list" id="">' +

            '										</div>' +
            '									</div>' +
            '								</div>' +

            '								</div>' +

            '							</div>'

        return dom
    }

    function destroyAphone(rid, wid, _id) {
        clearInterval(window['timer' + _id]);
        window['timer' + _id] = null;
        window[_id].destroy();
        removeArrItem(window[_id], waveArr);
        if (rid == detailCallInfo.robot_id && modalStatus) {
            $('#select_manual_check_result').val(0);
            $('#txt_manual_check_comment').val('');
            wave_detail.destroy();
            clearInterval(timerwave_detail);
            timerwave_detail = null;
            removeArrItem(wave_detail, waveArr);
        }

        var thisCallId = $('#' + _id).closest('.aphone').find('.call_id').eq(0).val();
        setTimeout(function() {
            getNextPhone(rid, _id, thisCallId,30);
        }, 5000)
        // 				if (rid != detailCallInfo.robot_id) {
        //
        // 				}
    }


    function getNextPhone(rid, _id, thisCallId, timeout) {
        var businessId = $('#' + _id).closest('.phone-col').find('.business_id').val();
        var callId = $('#' + _id).closest('.phone-col').find('.call_id').val();
        timeout = timeout - 1;
        // console.log(taskId)
        $.ajax({
            url: "<%=basePath%>/monitor/getRunningCallByBusinessId.do",
            type: "post",
            dataType: "json",
            data: 'businessId=' + businessId + '&callId=' + callId,
            success: function(data) {
                if (data["errorCode"] == "0") {
                    if (data.list.length == 0) {
                        // myNotify("error", "", "当前没有正在外呼的电话");
                        $('#' + _id).closest('.aphone').attr('onListen', false);
                        $('#' + _id).closest('.aphone').removeAttr('id');
                        $('#' + _id).closest('.aphone').addClass('no-phone');
                        $('#' + _id).removeAttr('id');
                    }

                    if (data.list.length != 0 && data.list[0].call_id != callId&&data.list[0].robot_id) {
                        var item = data.list[0];
                        for(var t=0;t<result.length;t++) {
                            if(result[t].call_id == callId) {
                                result[t] = item;
                                break
                            }
                        }

                        for(var e=0;t<allResult.length;e++) {
                            if(allResult[e].call_id == callId) {
                                allResult[e] = item;
                                break
                            }
                        }
                        var _container = $('#' + _id).closest('.phone-col');
                        _container.empty();
                        var dom = returnDom(item);
                        _container.append(dom);
                        // 									_container.find('.pause-btn').hide();
                        // 									_container.find('.unfavor-btn').hide();
                        nextSecond(_container.find('.aphone'));
                        _container.find('.pause-btn').hide();
                        if (item.callCount == 0) {
                            _container.find('.unfavor-btn').hide();
                        } else {
                            _container.find('.favor-btn').hide();
                        }

                        var _idn = "wave" + item.robot_id;
                        var _ridn = item.robot_id;
                        window[_idn] = WaveSurfer.create({
                            container: '#' + _idn,
                            waveColor: "#007477", //波纹
                            progressColor: "#6d9e8b",
                            hideScrollbar: false, //隐藏波纹的横坐标
                            cursorColor: "#002138",
                            height: 60,
                            responsive: true,
                            scrollParent: true,
                            maxCanvasWidth: 50000, // canvas的最大值
                            splitChannels: false,
                            interact: false,
                            barHeight: 0.8,
							backgroundColor: "#002138"
                        });

                        if(window['playId'] == 'wave'+rid) {
                            window['playId'] = item.robot;
                            window.player.reload({
                                encoding: '16bitInt',
                                channels: channels,
                                sampleRate: sampleRate,
                                flushingTime: 200,
                                log_info: false
                            });
                        }
                        waveArr.push(window[_idn]);
                        listenAphone(_ridn, window[_idn], _idn);

                        if (thisCallId == detailCallInfo.call_id && modalStatus) {
                            $('.detail-text').empty();

                            detailCallInfo = data.list[0];
                            initDetailView();
                            // 									var _idnDetail = "wave_detail";
                            // 									var _ridnDetail = item.robot_id;
                            //
                            // 									detailCallId = item.call_id;
                            // 									detailTaskName = item.task_name;
                            // 									detailBusinessName = item.business_name;
                            // 									detailCallInfo.robot_id = item.robot_id;
                            //
                            // 									$('.detailTask').html(detailTaskName);
                            // 									$('.detailBusiness').html(detailBusinessName);
                            //
                            // 									window[_idnDetail] = WaveSurfer.create({
                            // 										container: '#' + _idnDetail,
                            // 										waveColor: "#90EE90", //波纹
                            // 										progressColor: "#6d9e8b",
                            // 										hideScrollbar: false, //隐藏波纹的横坐标
                            // 										cursorColor: "#002138",
                            // 										height: 60,
                            // 										responsive: true,
                            // 										scrollParent: true,
                            // 										maxCanvasWidth: 50000, // canvas的最大值
                            // 										splitChannels: true,
                            // 										interact: false,
                            // 										barHeight: 0.8
                            // 									});
                            // 									waveArr.push(window[_idnDetail]);
                            // 									listenAphone(_ridnDetail, window[_idnDetail], _idnDetail);
                        }
                    }

                    if (data.list.length != 0 && data.list[0].call_id != callId&& !data.list[0].robot_id) {
                        if(timeout>0) {
                            setTimeout(function() {
                                getNextPhone(rid, _id, thisCallId, timeout)
                            }, 1000)
                        }else {//超时设置

                        }
                    }
                }
            },
            error: function(data) {
                // console.log('网络 异常5');
                myNotify("error", "", "网络异常！");
            }
        });
    }

    // 			监听电话	 nodeRid机器人id 	waveNodeId波形图对象  nodeId监听窗口id
    function listenAphone(nodeRid, waveNodeId, nodeId) {
        var audioCTX = new AudioContext();
        if (!window['client' + nodeRid]) {
            window['client' + nodeRid] = new RobServicesClient(grpcHost, null, null);
        }
        // 200s   语音时长
        var longAudioBufLen = sampleRate * 200;
        window['longAudioBuf' + nodeId] = audioCTX.createBuffer(2, longAudioBufLen, sampleRate);
        var longAudioBufPos = 0;
        waveNodeId.loadDecodedBuffer(window['longAudioBuf' + nodeId]);
        // 画布长度
        var canvasWidth = Math.round(waveNodeId.getDuration() * waveNodeId.params.minPxPerSec * waveNodeId.params.pixelRatio);
        // 窗口长度
        var drawWidth = waveNodeId.drawer.getWidth();
        var _left = drawWidth;
        var scrollLimit = drawWidth - canvasWidth;
        $('#' + nodeId).find('wave').eq(0).css('overflow', 'hidden');
        var targetNode = $("#" + nodeId).parent('.phone-main');
        // 				if(nodeRid == detailCallInfo.robot_id) {
        // 					audioCTXDetail = new AudioContext();
        // 					longAudioBufLenDetail = sampleRate * 200;
        // 					window['longAudioBufDetail'] =  audioCTXDetail.createBuffer(2, longAudioBufLenDetail, sampleRate);
        // 					longAudioBufPosDetail = 0;
        // 					wave_detail.loadDecodedBuffer(window['longAudioBufDetail']);
        // 					return;
        // 				}
        var audioReq = new AudioReq();
        audioReq.setIdx(nodeRid);
        var audioStream = window['client' + nodeRid].getAudio(audioReq, {});
        audioStreamArr.push(audioStream);
        var infoReq = new InfoReq();
        infoReq.setIdx(nodeRid);
        var infoStream = window['client' + nodeRid].getInfo(infoReq, {});
        infoStreamArr.push(infoStream);
        audioStream.on('data', function(response) {
            // console.log('auidoStream:' + nodeRid)
            if (!window['timer' + nodeId]) {
                window['timer' + nodeId] = setInterval(function() {
                    // 200*1000/4000 = 50
                    _left = _left - 1;
                    if (_left > scrollLimit && _left <= 0) {
                        $('#' + nodeId).find('wave').eq(0).scrollLeft(_left)
                        $('#' + nodeId).find('canvas').animate({
                            left: _left + "px"
                        }, 50);
                    } else if (_left <= scrollLimit) {
                        clearInterval(window['timer' + nodeId])
                        window['timer' + nodeId] = null;
                    }
                }, 50)

                intervalArr.push(window['timer' + nodeId])
            }
            if (response.getDataFlag() == 'END') {
                // 通话结束   清除声纹   清除定时器  发送请求获取新的机器人id   重置窗口信息;
                console.log('audio stream is end');
                return
            }
            var audio = response.getAudioData();
            if (audio && waveNodeId) {
                var pcmArray = LRInt8ArrayToInt16StereoPCM(audio.getSysAudio(), audio.getUsrAudio());
                AddLRInt8ArrayToAudioBuffer(window['longAudioBuf' + nodeId], audio.getSysAudio(), audio.getUsrAudio());

                // 						var drawFlag = false;
                // 						for(var k=0;k<result.length;k++) {
                // 							if(result[k].robot_id == nodeRid) {
                // 								drawFlag = true;
                // 								break
                // 							}
                // 						}
                if (longAudioBufPos % (sampleRate / 4) == 0) {
                    if (!waveNodeId.isDestroyed && $('#' + nodeId)[0]) {
                        // waveNodeId.empty()
                        waveNodeId.drawBuffer();
                    }



                    if (longAudioBufPos >= longAudioBufLen - audio.getSysAudio().length / 2) {
                        longAudioBufPos = 0;
                    }


                }

                if (detailCallInfo.robot_id == nodeRid && modalStatus) {
                    var pcmArrayDetail = LRInt8ArrayToInt16StereoPCM(audio.getSysAudio(), audio.getUsrAudio());
                    AddLRInt8ArrayToAudioBufferDetail(longAudioBufDetail, audio.getSysAudio(), audio.getUsrAudio());

                    if (longAudioBufPosDetail % (sampleRate / 4) == 0) {
                        // waveNodeId.empty()
                        wave_detail.drawBuffer();


                        if (longAudioBufPosDetail >= longAudioBufLenDetail - audio.getSysAudio().length / 2) {
                            longAudioBufPosDetail = 0;
                        }


                    }
                }

                if (window['playId'] == nodeId) {
                    player.feed(pcmArray);
                }
            }
        });

        audioStream.on('status', function(status) {
            console.log(status.code);
            console.log(status.details);
            console.log(status.metadata);
        });

        audioStream.on('end', function(end) {
            console.log("stream on END");
        });


        infoStream.on('data', function(response) {
            var type = response.getType();
            var content = response.getContext();
            // console.log(content)
            if (type == 'callText') { //对话文本
                var audioText = $.parseJSON(content);
                var audioHtml;
                if (audioText.robot) {
                    if (audioText.robot == "<repeat>") {
                        audioText.robot= '&lt;repeat&gt;'
                    }
                    audioHtml = '<div class="a-message robot-message">' +
                        '															<div class="text-left">' +
                        '																机器人' +
                        '															</div>' +
                        '															<div class="row">' +
                        '																<div class="col-xs-1 message-face">' +
                        '																<img src="<%=basePath%>/images/robot.png">' +
                        '																</div>' +
                        '																<div class="col-xs-10 message-text">' +
                        audioText.robot +
                        '																</div>' +
                        '															</div>' +
                        '														</div>';
                    var _list = targetNode.find('.audio-text-list');
                    _list.append(audioHtml);
                    var scrolleHeight = _list[0].scrollHeight;
                    if (scrolleHeight > _list[0].clientHeight) {
                        _list.stop().animate({
                            scrollTop: scrolleHeight
                        }, 300);
                    }

                    if (nodeRid == detailCallInfo.robot_id && modalStatus) {
                        var detailList = $('.detail-text');
                        detailList.append(audioHtml);
                        var scrolleHeightDet = detailList[0].scrollHeight;
                        if (scrolleHeightDet > detailList[0].clientHeight) {
                            detailList.stop().animate({
                                scrollTop: scrolleHeightDet
                            }, 300);
                        }
                    }
                }
                if (audioText.user) {
                    if (audioText.user == "<start>") {
                        audioText.user = '&lt;start&gt;'
                    }

                    if (audioText.user == "<end>") {
                        audioText.user = '&lt;end&gt;'
                    }
                    audioHtml = '<div class="a-message user-message">' +
                        '															<div class="text-right">' +
                        '																用户' +
                        '															</div>' +
                        '															<div class="row">' +
                        '																<div class="col-xs-1">' +
                        '																</div>' +
                        '																<div class="col-xs-10 message-text">' +
                        audioText.user +
                        '																</div>' +
                        '																<div class="col-xs-1 message-face">' +
                        '																	<img src="<%=basePath%>/images/user.png">' +
                        '																</div>' +
                        '															</div>' +
                        '														</div>';
                    var _list = targetNode.find('.audio-text-list');
                    _list.append(audioHtml);
                    var scrolleHeight = _list[0].scrollHeight;
                    if (scrolleHeight > _list[0].clientHeight) {
                        _list.stop().animate({
                            scrollTop: scrolleHeight
                        }, 300);
                    }

                    if (nodeRid == detailCallInfo.robot_id && modalStatus) {
                        var detailList = $('.detail-text');
                        detailList.append(audioHtml);
                        var scrolleHeightDet = detailList[0].scrollHeight;
                        if (scrolleHeightDet > detailList[0].clientHeight) {
                            detailList.stop().animate({
                                scrollTop: scrolleHeightDet
                            }, 300);
                        }
                    }
                }
            }
            if (nodeRid == detailCallInfo.robot_id && type != 'callText' && showCallControlSwitch) { //控制台意图
                // console.log('接收意图：' + new Date().getTime());
                // console.log(content);
                var branchHtml = $('.branch-top').html();
                var faqHtml = $('.faq').html();
                if (type == 'topn' && !(branchHtml == '' && faqHtml == '')) { //topn/
                    // console.log(11)
                    // console.log('接收topn：' + new Date().getTime());
                    var topnText = $.parseJSON(content);
                    $(topnText).each(function(index, item) {
                        if (item.id == 0) {
                            if (!sendIntention) {
                                sendIntention = item.intention;
                            }

                        }
                        var intentions = $('.intention-row');
                        for (var i = 0; i < intentions.length; i++) {
                            if ($(intentions[i]).attr('intention') == item.intention) {
                                if (item.id == 0) {
                                    $(intentions[i]).addClass('intention-row-first');
                                }
                                $(intentions[i]).find('.intention-rank').html('<span class="rank">' + (item.id + 1) + '</span>');
                                if (index == 2) {
                                    break
                                }
                            }
                        }
                    })
                    // console.log('渲染topn：' + new Date().getTime());
                    timeProressBar();
                }

                if (type == 'topn' && branchHtml == '' && faqHtml == '') {
                    // console.log(22)
                    // console.log('接收topn：' + new Date().getTime());
                    var topnText = $.parseJSON(content);
                    $(topnText).each(function(index, item) {
                        if (item.id == 0) {
                            var infoPack = new InfoPack();
                            infoPack.setRobIdx(detailCallInfo.robot_id);
                            infoPack.setType('intervention');
                            infoPack.setContext(item.intention);
                            window['client' + detailCallInfo.robot_id].sndInfoOnce(infoPack, {}, function(msg) {

                            })
                        }
                    })
                }

                if (type == 'intention') { //意图
                    initIntention(content, nodeRid)
                }
            }
            if (type == 'hangup' && nodeRid != detailCallInfo.robot_id) {
                console.log('info stream is end');
                // 					var infoPack = new InfoPack();
                // 					infoPack.setRobIdx(nodeRid);
                // 					infoPack.setType('close');
                // 					window['client_detail'].sndInfoOnce(infoPack, {}, function (msg) {
                //
                // 					})

                audioStream.cancel();
                infoStream.cancel();
                $('#wave' + nodeRid).closest('.aphone').attr('onListen', 'false');
                destroyAphone(nodeRid, waveNodeId, nodeId);
                return
            } else if (type == 'hangup' && nodeRid == detailCallInfo.robot_id) {
                // console.log(content);
                if(showCallControlSwitch) {
                    var infoPack = new InfoPack();
                    infoPack.setRobIdx(nodeRid);
                    infoPack.setType('close');
                    window['client' + nodeRid].sndInfoOnce(infoPack, {}, function(msg) {

                    })

                    $('.branch-top').empty();
                    $('.faq-bottom').empty();
                    $('.faq').empty();
                    $('.branch-top').html('通话已结束');
                }
                $('.duration').hide();
                audioStream.cancel();
                infoStream.cancel();
                $('#wave' + nodeRid).closest('.aphone').attr('onListen', 'false');
                console.log('info stream is end');

                destroyAphone(nodeRid, waveNodeId, nodeId);
                return
            }
        });
        infoStream.on('status', function(status) {
            console.log(status.code);
            console.log(status.details);
            console.log(status.metadata);
        });
        infoStream.on('end', function(end) {
            console.log("stream on END");
        });



        // 音频相关
        function LRInt8ArrayToInt16StereoPCM(arrayL, arrayR) {
            var newArray = new Int16Array(arrayL.length); // *2/2 = *1
            for (var i = 0; i < arrayL.length / 2; i++) {
                var L = int8Toint16(arrayL[i * 2], arrayL[i * 2 + 1]);
                var R = int8Toint16(arrayR[i * 2], arrayR[i * 2 + 1]);
                newArray[2 * i] = L;
                newArray[2 * i + 1] = R;
            }
            return newArray;
        }

        function LRInt8ArrayToFloat32StereoPCM(arrayL, arrayR) {
            var newArray = new Float32Array(arrayL.length); // *2/2 = *1
            for (var i = 0; i < arrayL.length / 2; i++) {
                var L = int8Toint16(arrayL[i * 2], arrayL[i * 2 + 1]) / 32767.5;
                var R = int8Toint16(arrayR[i * 2], arrayR[i * 2 + 1]) / 32767.5;
                newArray[2 * i] = L;
                newArray[2 * i + 1] = R;
            }
            return newArray;
        }

        function Float32PcmToAudioBuffer(float32Array) {
            var buffer = audioCTX.createBuffer(2, float32Array.length / 2, sampleRate);
            var L = buffer.getChannelData(0);
            var R = buffer.getChannelData(1);
            for (var i = 0; i < float32Array.length / 2; i++) {
                // Math.random() is in [0; 1.0]
                // audio needs to be in [-1.0; 1.0]
                L[i] = float32Array[i * 2];
                R[i] = float32Array[i * 2 + 1];
                //console.log(L[i],R[i]);
            }
            return buffer;
        }

        function LRInt8ArrayToAudioBuffer(arrayL, arrayR) {
            var buffer = audioCTX.createBuffer(2, arrayL.length / 2, sampleRate);
            var L = buffer.getChannelData(0);
            var R = buffer.getChannelData(1);
            for (var i = 0; i < arrayL.length / 2; i++) {
                L[i] = int8Toint16(arrayL[i * 2], arrayL[i * 2 + 1]) / 32767.5;
                R[i] = int8Toint16(arrayR[i * 2], arrayR[i * 2 + 1]) / 32767.5;
                //console.log(L[i],R[i]);
            }
            return buffer;
        }

        function AddLRInt8ArrayToAudioBuffer(audioBuffer, arrayL, arrayR) {
            var L = audioBuffer.getChannelData(0);
            var R = audioBuffer.getChannelData(1);
            var len = arrayL.length / 2;
            for (var i = 0; i < len; i++) {
                // Math.random() is in [0; 1.0]
                // audio needs to be in [-1.0; 1.0]
                L[longAudioBufPos + i] = int8Toint16(arrayL[i * 2], arrayL[i * 2 + 1]) / 32767.5;
                R[longAudioBufPos + i] = int8Toint16(arrayR[i * 2], arrayR[i * 2 + 1]) / 32767.5;
                //console.log(L[i],R[i]);
            }
            longAudioBufPos += len;
        }

        function AddLRInt8ArrayToAudioBufferDetail(audioBuffer, arrayL, arrayR) {
            var L = audioBuffer.getChannelData(0);
            var R = audioBuffer.getChannelData(1);
            var len = arrayL.length / 2;
            for (var i = 0; i < len; i++) {
                // Math.random() is in [0; 1.0]
                // audio needs to be in [-1.0; 1.0]
                L[longAudioBufPosDetail + i] = int8Toint16(arrayL[i * 2], arrayL[i * 2 + 1]) / 32767.5;
                R[longAudioBufPosDetail + i] = int8Toint16(arrayR[i * 2], arrayR[i * 2 + 1]) / 32767.5;
                //console.log(L[i],R[i]);
            }
            longAudioBufPosDetail += len;
        }

        function int8Toint16(v1, v2) {
            var a = new Int16Array(1);
            a[0] = 0;
            a[0] = a[0] | ((v2 & 0xFF) << 8);
            a[0] = a[0] | (v1 & 0xFF);
            //console.log(v1,v2,a[0]);
            return a[0];
        }
    }

    //播放列表中通话
    function playThis(obj) {
        $('.pause-btn').hide();
        $('.play-btn').show();
        var _id = $(obj).attr('target');
        // console.log(_id)
        window.player.reload({
            encoding: '16bitInt',
            channels: channels,
            sampleRate: sampleRate,
            flushingTime: 200,
            log_info: false
        });
        window['playId'] = _id;
        $(obj).hide();
        $(obj).parent().find('.pause-btn').show();
    }
    //暂停列表中通话
    function pauseThis(obj) {

        var _id = $(obj).attr('target');
        // console.log(_id)
        window.player.reload({
            encoding: '16bitInt',
            channels: channels,
            sampleRate: sampleRate,
            flushingTime: 200,
            log_info: false
        });
        window['playId'] = "";

        $(obj).hide();
        $(obj).parent().find('.play-btn').show();
    }


    var detailTaskName;
    var detailBusinessName;
    // 打开通话详情
    $(document).on('click', '.phone-main', function(e) {
        e.stopPropagation();
        var detailIndex = parseInt($(this).closest('.phone-col').attr('position'));
        detailCallInfo = result[detailIndex];
        if (detailCallInfo.callCount == 0) {
            $('#myModal').find('.unfavor-btn').hide();
        } else {
            $('#myModal').find('.favor-btn').hide();
        }
        // $('#myModal').modal();

        // 查询电话锁
        $.ajax({
            url: "<%=basePath%>/monitor/callLockStatus.do ",
            type: "post",
            dataType: "json",
            async: false,
            data: {
                callId: detailCallInfo.call_id,
            },
            success: function(data) {
                if (data["errorCode"] == "0") {
                    if (data.result == 0) {
                        lockStatus = 0;
                    } else if (data.result == 1) {
                        lockStatus = 1;
                    }
                }
            },
            error: function(data) {
                // console.log('网络 异常6');
                myNotify("error", "", "网络异常！");
            }
        });

        if (lockStatus == 0) { //已上锁
            myNotify("error", "", "该通话已被监听！");
        } else if (lockStatus == 1) { //未上锁
            $.ajax({
                url: "<%=basePath%>/monitor/callOperate.do ",
                type: "post",
                dataType: "json",
                async: false,
                data: {
                    callId: detailCallInfo.call_id,
                    status: 0
                },
                success: function(data) {
                    if (data["errorCode"] == "0") {
                        $('#myModal').modal();
                    }
                },
                error: function(data) {
                    // console.log('网络 异常7');
                    myNotify("error", "", "网络异常！");
                }
            });

        }
    })

    // 通话详情模态框隐藏之后
    $('#myModal').on('hide.bs.modal', function() {
        modalStatus = false;
        // 销毁波形
        wave_detail.destroy();
        // 清除波形进度定时器
        clearInterval(window['timerwave_detail'])
        window['timerwave_detail'] = null;
        window['playId'] = "";
        var infoPack = new InfoPack();
        infoPack.setRobIdx(detailCallInfo.robot_id);
        infoPack.setType('close');
        window['client' + detailCallInfo.robot_id].sndInfoOnce(infoPack, {}, function(msg) {

        })
        // console.log(detailCallInfo.call_id)
        $.ajax({
            url: "<%=basePath%>/monitor/callOperate.do ",
            type: "post",
            dataType: "json",
            async: false,
            data: {
                callId: detailCallInfo.call_id,
                status: 1
            },
            success: function(data) {
                if (data["errorCode"] == "0") {}
            },
            error: function(data) {
                // console.log('网络 异常8');
                myNotify("error", "", "网络异常！");
            }
        });
        window.player.reload({
            encoding: '16bitInt',
            channels: channels,
            sampleRate: sampleRate,
            flushingTime: 200,
            log_info: false
        });
    })

    // 通话详情模态框弹出之后
    $('#myModal').on('shown.bs.modal', function() {
        initDetailView();
    })

    $("#form_manual_check").click(function(event) { //保存人工校驗
        event.preventDefault();
        var manualCheckResult = $("#select_manual_check_result").find("option:selected").val().trim();
        if (manualCheckResult == "0") {
            createNotify = myNotify("warning", "", "请正确选择人工校验结果！", createNotify);
            return false;
        }
        var manualCheckComment = $("#txt_manual_check_comment").val().trim();

        $.ajax({
            url: "<%=basePath%>/call/saveManualCheckResultInfo.do",
            data: function() {
                return "call_id=" + detailCallInfo.call_id + "&manual_check_result=" + manualCheckResult + "&manual_check_comment=" +
                    encodeURI(manualCheckComment);
            }(),
            async: false,
            dataType: "json",
            success: function(data) {
                if (data["errorCode"] == "0") {
                    createNotify = myNotify("success", "", "保存成功！", createNotify);
                } else {
                    createNotify = myNotify("error", "", "保存失败！", createNotify);
                }
            },
            error: function() {}
        });
    });


    function initDetailView() {
        $('.duration').show();
        // $('.detailTask').html(detailCallInfo.task_name);
        $('.detailBusiness').html(detailCallInfo.business_name);
        $('.detailPhone').html(detailCallInfo.phone_number);
        $('#myModal').find('.favor-btn').show();
        $('#myModal').find('.unfavor-btn').show();
        if (detailCallInfo.callCount == 0) {
            $('#myModal').find('.unfavor-btn').hide();
        } else {
            $('#myModal').find('.favor-btn').hide();
        }

        window['playId'] = 'wave' + detailCallInfo.robot_id;
        // 重新生成波形
        wave_detail = WaveSurfer.create({
            container: '#wave_detail',
            waveColor: "#007477", //波纹
            progressColor: "#6d9e8b",
            hideScrollbar: false, //隐藏波纹的横坐标
            cursorColor: "#002138",
            height: 60,
            responsive: true,
            scrollParent: true,
            maxCanvasWidth: 50000, // canvas的最大值
            splitChannels: true,
            interact: false,
            barHeight: 0.8,
			backgroundColor: "#002138"
        });


        $('#myModal').find('wave').eq(0).css('overflow', 'hidden');

        // 重置pcm-player语音流
        window.player.reload({
            encoding: '16bitInt',
            channels: channels,
            sampleRate: sampleRate,
            flushingTime: 200,
            log_info: false
        });

        $('.branch-top').empty();
        $('.faq-bottom').empty();
        $('.faq').empty();
        $('.detail-text').empty();

        if (showCallControlSwitch) {
            var infoPack = new InfoPack();
            infoPack.setRobIdx(detailCallInfo.robot_id);
            infoPack.setType('start');

            // console.log('send Start time:' + new Date());
            window['client' + detailCallInfo.robot_id].sndInfoOnce(infoPack, {}, function(response) {
                console.log('callback time:' + new Date());
            })
        }


        if (audioCTXDetail) {
            audioCTXDetail.close();
        }
        audioCTXDetail = new AudioContext();
        longAudioBufLenDetail = sampleRate * 200;
        longAudioBufDetail = audioCTXDetail.createBuffer(2, longAudioBufLenDetail, sampleRate);
        longAudioBufPosDetail = 0;
        wave_detail.loadDecodedBuffer(longAudioBufDetail);
        var canvasWidth = Math.round(wave_detail.getDuration() * wave_detail.params.minPxPerSec * wave_detail.params.pixelRatio);
        var drawWidth = wave_detail.drawer.getWidth();
        var _left = drawWidth;
        var scrollLimit = drawWidth - canvasWidth;
        window['timerwave_detail'] = setInterval(function() {
            // 200*1000/4000 = 50
            _left = _left - 1;
            if (_left > scrollLimit && _left <= 0) {
                $('#wave_detail').find('wave').eq(0).scrollLeft(_left)
                $('#wave_detail').find('canvas').animate({
                    left: _left + "px"
                }, 50);
            } else if (_left <= scrollLimit) {
                clearInterval(window['timerwave_detail'])
                window['timerwave_detail'] = null;
            }
        }, 50)

        modalStatus = true;
    }

    // 打开/关闭工作台
    function toggleWorkBench(obj) {
        var _status = $('#workbench').attr('status');
        if (_status == 1) {
            $('#workbench').attr('status', 0);
            $('#myModal').find('.modal-content').css('width', '702px');
            $('#workbench').hide();
            // $('#workbench-worker').html('打开工作台')
			$('#workbench-worker').addClass("open")
        } else {
            $('#workbench').attr('status', 1);
            $('#myModal').find('.modal-content').css('width', '1100px');
            $('#workbench').show();
			$('#workbench-worker').removeClass("open")
            // $('#workbench-worker').html('关闭工作台');
        }
    }

    function toggleFavor(status, callId, obj) { //收藏/取消收藏
        $.ajax({
            url: "<%=basePath%>/monitor/collectCall.do ",
            type: "post",
            dataType: "json",
            async: false,
            data: {
                callId: callId,
                isCollect: status
            },
            success: function(data) {
                if (data["errorCode"] == "0") {
                    $(obj).hide();

                    var position;
                    for(var i=0;i<result.length;i++) {
                        if(result[i].call_id==callId) {
                            position = i;
                            result[i].callCount = status;
                        }
                    }
                    if (status == 0) {
                        $(obj).parent().find('.favor-btn').show();
                        $('.phone-col').eq(position).find('.unfavor-btn').hide();
                        $('.phone-col').eq(position).find('.favor-btn').show();
                    } else {
                        $(obj).parent().find('.unfavor-btn').show();
                        $('.phone-col').eq(position).find('.favor-btn').hide();
                        $('.phone-col').eq(position).find('.unfavor-btn').show();
                    }
                }
            },
            error: function(data) {
                // console.log('网络 异常9');
                myNotify("error", "", "网络异常！");
            }
        });
    }

    //删除数组中某一项
    function removeArrItem(val, arr) {
        var index = arr.indexOf(val);
        if (index > -1) {
            arr.splice(index, 1);
        }
    }

    //
    function nextSecond(node) {
    	console.log(node)
        //node为aphone
        var time = parseInt(node.find('.time').val());
        setTimeout(function() {
            if (node.attr('onListen') == 'true') {
				console.log(time)
                node.find('.time').val(time + 1);
                node.find('.phone-time').html(time + 1 + 'S');
                nextSecond(node);
            }
        }, 1000)
    }

    var sendIntention;

    function sendInfo(node) {
        $('.intention-row').removeClass('intention-row-active');
        $(node).addClass('intention-row-active');
        var intention = $(node).attr('intention');
        // console.log('*****' + intention)
        sendIntention = intention;
    }

    function sndInfoOnce() {
        if(sndInfoOnceTimer) {
            clearTimeout(sndInfoOnceTimer)
            sndInfoOnceTimer = null
        }
        var infoPack = new InfoPack();
        infoPack.setRobIdx(detailCallInfo.robot_id);
        infoPack.setType('intervention');
        infoPack.setContext(sendIntention);
        window['client' + detailCallInfo.robot_id].sndInfoOnce(infoPack, {}, function(msg) {

        })
        // console.log('發送意圖：' + new Date().getTime());
        // console.log('發送意圖：' + sendIntention);
        $('.branch-top').empty();
        $('.faq-bottom').empty();
        $('.faq').empty();
    }

    function initProressBar() {
        $('#audio_progress2').css('width', '0');
        $('#audio_progress2').html('0s');
        intentionTime = 0;
    }

    function timeProressBar() {
        if (intentionTime == 0) {
            intentionTime = callOperateDuration;
        }

        if (intentionTime == 0) {
            sndInfoOnce();
        } else {
            $('#audio_progress2').html((callOperateDuration/100) + 's');
            $('#audio_progress2').css('width', '100%');
            $("#audio_progress2").animate({width:"0"},callOperateDuration);
            sndInfoOnceTimer = setTimeout(function() {
                sndInfoOnce();
            },callOperateDuration)

// 					var flushTime = callOperateDuration / 100
// 					intentionTime = intentionTime - flushTime;
// 					var visibileTime = (intentionTime / callOperateDuration).toFixed(2);
// 					$('#audio_progress2').html(visibileTime + 's');
// 					var percent = 100 - ((callOperateDuration - intentionTime) / flushTime);
// 					$('#audio_progress2').css('width', percent + '%');
// 					if (intentionTime > 0) {
// 						setTimeout(function() {
// 							timeProressBar();
// 						}, flushTime)
// 					} else if (intentionTime == 0) {
// 						sndInfoOnce();
// 					}
        }
    }

    //渲染意圖
    function initIntention(content, rid) {
        $('.branch-top').empty();
        $('.faq-bottom').empty();
        $('.faq').empty();
        sendIntention = '';
        initProressBar();
        var intentionText = $.parseJSON(content);
        var UAText = intentionText.UA;
        var UIText = intentionText.UI;
        var UAHtml = '';
        var UIHtmlBot = '';
        var UIHtml = '';
        $(UIText).each(function(index, item) {
            if (index < 17) {
                UIHtml += '<div class="row margin-top-10 intention-row" intention="' + item + '" onclick="sendInfo(this,' +
                    rid + ')">' +
                    '												<div class="col-xs-2 text-center intention-rank"></div>' +
                    '												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">' +
                    item + '</button></div>' +
                    '											</div>';
            } else {
                UIHtmlBot = '<div class="row margin-top-10 intention-row" intention="' + item + '" onclick="sendInfo(this,' +
                    rid + ')">' +
                    '												<div class="col-xs-2 text-center intention-rank"></div>' +
                    '												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">' +
                    item + '</button></div>' +
                    '											</div>' + UIHtmlBot;
            }
        })

        $(UAText).each(function(index, item) {
            UAHtml += '<div class="row margin-top-10 intention-row" intention="' + item + '" onclick="sendInfo(this,' +
                rid + ')">' +
                '												<div class="col-xs-2 text-center intention-rank"></div>' +
                '												<div class="col-xs-10 text-center intention-button"> <button type="button" class="btn btn-default btn-xs">' +
                item + '</button></div>' +
                '											</div>';
        })

        if (UAHtml) {
            $('.branch-top').append(UAHtml);
        }
        if (UIHtml) {
            $('.faq').append(UIHtml);
            $('.faq-bottom').append(UIHtmlBot);
        }
    }
</script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript" src="<%=basePath%>/lib/echarts/3.7.1/echarts.js"></script>

</body>

</html>
